﻿<%@ Control language="C#" Inherits="News.ViewNews" CodeFile="ViewNews.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>

<asp:Panel ID="pnlMenu" runat="server" Width="100%">
    <table width="100%" border="0">
        <tr>
            <td style="width: 150px"><asp:Label ID="Label1" runat="server" Text="Chuyên mục :"  CssClass="titletext3"></asp:Label></td>
            <td style="width: 820px"><asp:DropDownList ID="ddlNewsType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlNewsType_SelectedIndexChanged" DataSourceID="DSNews" DataTextField="description1" DataValueField="newsType">
            </asp:DropDownList>
                <asp:SqlDataSource ID="DSNews" runat="server"
                    SelectCommand="SELECT * FROM tm_newsType ORDER BY displayCode">
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="2"><hr class="table" /></td>
        </tr>
    </table>
</asp:Panel>

<asp:Panel ID="pnlShowNews" runat="server" Width="100%">
    <table border="0" width="100%">
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" ShowHeader="False" DataSourceID="dsShowNews" AutoGenerateColumns="False" Width="100%" AllowPaging="True" CaptionAlign="Right" BorderColor="White" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <table width="100%" border="0">
                                <tr>
                                    <td><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# getURL(DataBinder.Eval(Container, "DataItem.newsId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.subject") %></asp:HyperLink>
                                        &nbsp;&nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    <i>
                                    (<asp:Label ID="lblCreateDate" runat="server" Text='<%# Eval("createDate","{0:d}") %>'></asp:Label>)
                                    </i> 
                                    </td>   
                                </tr>
                                    <tr>
                                        <td>
                                            <p align="justify"><asp:Label ID="Label2" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.summary") %>'></asp:Label></p></td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="dsShowNews" runat="server"></asp:SqlDataSource>
</asp:Panel>

<asp:Panel ID="pnlShowDetailNews" runat="server" Visible="false" Width="100%"><TABLE width="100%" border=0><TBODY><TR><TD><asp:Label id="lblSubject" runat="server" CssClass="titletext2"></asp:Label> <asp:Label id="lblNewsType" runat="server" Text="Label" Visible="false" EnableViewState="true"></asp:Label></TD></TR><TR><TD align=right><asp:Label id="lblCreateDate" runat="server" Font-Italic="True"></asp:Label></TD></TR><TR><TD><P align=justify><asp:Label id="lblSummary" runat="server" Font-Bold="True" Font-Size="11pt"></asp:Label></P></TD></TR><TR><TD><asp:Label id="lblContents" runat="server" Text=""></asp:Label></TD></TR><TR><TD align=right><asp:Label id="lblSource" runat="server" Font-Bold="True"></asp:Label></TD></TR><TR><TD align=right>
<HR class="table" />
</TD></TR><TR><TD><LABEL><B>Các tin khác : </B></LABEL>
<HR class="table" />
<asp:GridView id="gvNewNews" Width="100%" runat="server" DataSourceID="dsNewNews" OnPageIndexChanging="gvNewNews_PageIndexChanging" AutoGenerateColumns="False" ShowHeader="False" GridLines="None"><Columns>
<asp:TemplateField><EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            
</EditItemTemplate>
<ItemTemplate>
                                
                                - <asp:HyperLink ID="HyperLink2" runat="server" ToolTip='<%# Eval("summary") %>' NavigateUrl='<%# getURL(DataBinder.Eval(Container, "DataItem.newsId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.subject") %></asp:HyperLink>&nbsp;
                                (<asp:Label ID="Label3" runat="server" Text='<%# getCreateDate(DataBinder.Eval(Container, "DataItem.createDate").ToString()) %>' Font-Italic="True"></asp:Label>)
                                
                                
                            
</ItemTemplate>
</asp:TemplateField>
</Columns>

<PagerStyle HorizontalAlign="Right"></PagerStyle>
</asp:GridView> </TD></TR><TR><TD><asp:Panel id="pnlAddToStore" runat="server" Visible="False">
                    <table width="100%">
                        <tr>
                            <td><asp:Button ID="btnAddToStore" runat="server" Text="Thêm vào kho" OnClick="btnAddToStore_Click" CssClass="btn" Width="90px" /></td>
                            <td align="left"><asp:Label ID="lblNotice" runat="server" Visible="false"></asp:Label></td>
                        </tr>
                    </table>
                </asp:Panel> </TD></TR></TBODY></TABLE><asp:SqlDataSource id="dsNewNews" runat="server"></asp:SqlDataSource></asp:Panel>
&nbsp;&nbsp;<br />
<asp:Label ID="lblDebugMessage" runat="server"></asp:Label>
